<template>
  <div class="mainCon">
    <div class="containercontent">
      <maintain-record :showButton='showObj'></maintain-record>
    </div>
  </div>
</template>

<script>
  import { mapState } from 'vuex'
  import maintainRecord from './instrumentPage/detailDialogPage/maintainRecord'

  export default {
    data() {
      let that = this;
      return {
        showObj: { add: true },
        RepairListParams: {
          bTime: "",
          eTime: "",
          equipmentName: "",
          page: 1,
          pageCount: 50,
        },
        addRecordShow: false,
        recordForm: {
          name: '',
          code: '',
          date: '',
          repairor: '',
          detail: '',
        },
        recordRules: {
          name: [
            { required: true, type: 'string', message: '请选择仪器名称', trigger: 'change' },
          ],
        },
        newOrEdit: 'new',
        yiqi: [
          {
            value: '001',
            label: '仪器1'
          }, {
            value: '002',
            label: '仪器2'
          }
        ],
        enableStatusValue: '3',
        methodCategoryValue: '',
        methodTypeValue: '',
        searchName: '',
        sampleTypeValue: '',
        currentPage: 1,
        frontEquipTypeValue: '',
        mainEquipTypeValue: '',
        //主仪器列表选中行
        currentRowMain: null,
        //辅助仪器列表选中行
        currentRowFront: null,
        eqDetailShow: false,
        //表示仪器详细信息显示权限
        eqDetailShowType: 'weixiu',
        //仪器详情中，是主仪器还是辅助仪器
        eqType: 'main',
        //仪器详情中，是新增仪器还是编辑仪器
        eqEditOrNew: '',
      }
    },
    props: ["userOpernation"],
    computed: {
      ...mapState(['enableStatus', 'tableHeightB', 'mainEquipType', 'frontEquipType', 'mainEquipTableData', 'frontEquipTableData']),
      tabDivHeight() {
        return window.innerHeight / 10
      }
    },
    mounted() {
      //  this.readEquipmentRepairList()
    },
    watch: {

    },
    components: {
      maintainRecord
    },
    methods: {
      //	readEquipmentRepairList.htm
      readEquipmentRepairList() {
        this.$http({
          method: 'post',
          apiUrl: '/resource/readEquipmentRepairList.htm',
          params: this.RepairListParams,
          isJson: true,
        }).then(res => {
          if (res.code === 0) {

          } else {
            //			          	reject(err)
          }
        }, )
      },
      editMaintEquipe: function (row) {

      },
      editFrontEquip: function (row) {

      },
      changeFrontEquipStatus: function (row) {
        console.log(row);
      },
      handleCurrentChangeMain: function (val) {
        this.currentRowMain = val;
      },
      handleCurrentChangeFront: function (val) {
        this.currentRowFront = val;
      },
      changeMainEquipStatus: function (row) {
        console.log(row);
      },
      handleSizeChange: function () {

      },
      handleCurrentChange: function () {

      },
      showEqDetail: function (type, edornew, detailType) {
        this.eqType = type;
        this.eqDetailShow = true;
        this.eqEditOrNew = edornew;
        this.eqDetailShowType = detailType;
      }
    }
  }

</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  /*.infoitem{
  width:calc((100% - 200px)/4);
}*/
  /*.infoitem:nth-child(1){
  width: 110px;
}*/

  .separaterow {
    margin-top: 10px;
  }

  .informationItem {
    width: calc(100% - 70px);
    float: right;
  }
</style>